package com.lagou.rpc.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 请求度量指标
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Metric implements Comparable<Metric>{
    //请求服务器ip
    private String ip;
    //请求服务器端口
    private int port;
    //请求开始时间戳
    private Long start;
    //请求耗时：毫秒
    private Long cost;

    @Override
    public int compareTo(Metric o) {
        return getCost().compareTo(o.getCost());
    }
}
